/*
 * Copyright (C) 2021 ShangHai Quicktron Intelligent Technology Co.,Ltd
 * All Rights Reserved.
 * 本软件为上海快仓智能科技开发研制。未经本公司正式书面同意，其他任何个人、团体
 * 不得使用、复制、修改或发布本软件.
 * 版权所有 翻版必究
 */

package com.kc.gb.device.service.support.dto;

import lombok.ToString;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 分播墙区
 */
@ToString
public class StationSlotArea implements Serializable {

    private static final long serialVersionUID = 1L;

    private String areaCode;

    private String areaLabel;

    private List<StationSlotLayer> layers;

    public String getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }

    public List<StationSlotLayer> getLayers() {
        if (layers == null) {
            layers = new ArrayList<>();
        }
        return layers;
    }

    public void setLayers(List<StationSlotLayer> layers) {
        this.layers = layers;
    }

    public StationSlotLayer getLayer(int layer) {
        for (StationSlotLayer slotLayer : this.getLayers()) {
            if (slotLayer.getLayer() == layer) {
                return slotLayer;
            }
        }
        return null;
    }

    public void addLayer(StationSlotLayer layer) {
        this.getLayers().add(layer);
    }


    public String getAreaLabel() {
        return areaLabel;
    }

    public void setAreaLabel(String areaLabel) {
        this.areaLabel = areaLabel;
    }

}
